Skip to content

fix(release): set GH_REPO so upload-release-assets can find the repo - #48

Merged
amondnet merged 1 commit into
mainfrom
fix/release-upload-repo-context
Jun 22, 2026
Merged

fix(release): set GH_REPO so upload-release-assets can find the repo#48
amondnet merged 1 commit into
mainfrom
fix/release-upload-repo-context

Conversation

@amondnet

@amondnet amondnet commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Problem

The v0.1.2 release run built all 6 targets successfully (including the musl target via cargo-zigbuild — the prior blocker is fixed 🎉), but upload-release-assets failed:

$ gh release upload "$RELEASE_TAG" release/* --clobber
failed to run git: fatal: not a git repository (or any of the parent directories): .git

This job downloads the build artifacts but never checks out the repo, so gh had no local .git to infer the target repository from. publish-npm and update-homebrew-formula then failed downstream — no assets reached the release, so the npm generator and the Homebrew checksum download had nothing to fetch (the resilience always() correctly let them run and fail loudly rather than silently skip).

This was latent: upload-release-assets had never actually run before (v0.1.0/v0.1.1 failed earlier in the matrix), so this is the first run to reach it.

Fix

Set GH_REPO: ${{ github.repository }} on the upload step. gh reads GH_REPO as the default repo, so it resolves the target without a checkout — mirroring how publish-npm already passes --repo "$GITHUB_REPOSITORY" to gh release download.

Recovery

npm Trusted Publishing (OIDC) and the Homebrew app-token job can only run inside the workflow, and the v0.1.2 release/tag already exists (so release-please won't re-trigger it). Merging this fix: cuts 0.1.3, which runs the full pipeline end-to-end with the upload fix. The empty v0.1.0/v0.1.1/v0.1.2 tags will be cleaned up after 0.1.3 publishes.

Test plan

  • YAML validated
  • All 6 builds already proven green on v0.1.2
  • 0.1.3 run uploads assets + publishes to npm via OIDC + updates Homebrew

Summary by cubic

Set GH_REPO to ${{ github.repository }} in the release upload job so gh release upload can target the repo without a checkout. Fixes failed asset uploads and unblocks downstream publish-npm and Homebrew updates.

Written for commit cb062ee. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Enhanced release workflow infrastructure to improve asset publishing reliability.

The v0.1.2 run built all 6 targets (zigbuild musl included) but
upload-release-assets failed: 'gh release upload' ran 'fatal: not a git
repository' because that job downloads artifacts without checking out the
repo, so gh had no local .git to infer the target from. publish-npm and the
Homebrew job then failed downstream because no assets reached the release
(the resilience always() correctly let them run and fail loudly).

Set GH_REPO=${{ github.repository }} so gh resolves the repo without a
checkout — mirrors how publish-npm already passes --repo to gh release download.
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e5d3b9a-1e88-4e19-8322-831d983253c7

📥 Commits

Reviewing files that changed from the base of the PR and between 1f145b6 and cb062ee.

📒 Files selected for processing (1)
  • .github/workflows/release-rust.yml

📝 Walkthrough

Walkthrough

The upload-release-assets job in .github/workflows/release-rust.yml gains an env block that sets GH_REPO to ${{ github.repository }}, and two inline comments are added to the run step noting that the job does not check out the repository and that GH_REPO must therefore be set explicitly.

Changes

Release Workflow: Explicit GH_REPO for upload-release-assets

Layer / File(s) Summary
Set GH_REPO and clarify no-checkout context
.github/workflows/release-rust.yml
Adds GH_REPO: ${{ github.repository }} to the job env block and inserts comments in the run step explaining the job has no repo checkout, requiring the explicit env var for gh to target the correct repository.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 No checkout? No worry, I'll point the way!
A single env var keeps confusion at bay,
GH_REPO now whispers, "This repo, right here!"
The gh CLI hops on with nothing to fear.
Three little lines, yet the release runs clear! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: setting GH_REPO environment variable to fix the upload-release-assets workflow step that failed due to missing repository context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/release-upload-repo-context

Comment @coderabbitai help to get the list of available commands and usage tips.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@amondnet
amondnet merged commit dcfd873 into main Jun 22, 2026
7 checks passed
@amondnet
amondnet deleted the fix/release-upload-repo-context branch June 22, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant